<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/web/js/global/global_header.js"></script>
    <title>华锐Pms</title>
</head>
<style>
    .el-table--border .el-table__cell:first-child .cell {
        padding-left: 14px;
        overflow: visible !important;
    }
</style>

<body>
    <div id="app" class="bgc-f2 pl-16 pr-16 pt-16" v-cloak>
        <div>
            <div class="bor-fa bgc-ff mb-16 pl-16 pa-12-16 tx-14" v-if="conceal == 1">
                钟点房默认为0.5夜间，如需修改，可点击"设置钟点房夜间量"进行修改。
                <i class="el-icon-close ufr" @click="conceal = 2"></i>
            </div>
            <div class="ub ub-ac ub-pe mb-16">
                <div>
                    <!-- v-haspermi="['system:user:add']" -->
                    <el-button size="small" @click="editClick(1,'')" class="tx-14">设置钟点房夜间量</el-button>
                    <el-button type="primary" size="small" @click="editClick(2,'')" class="tx-14">新增钟点房</el-button>
                </div>
            </div>
            <div class="bgc-wh ">
                <el-table :data="tableData" style="width: 100%" border
                    :header-cell-style="{background:'#eaedf4','color':'#333',padding:'8px 0'}" ref="multipleTable">
                    <!-- <el-table-column type="selection" width="40" align="center">
                    </el-table-column> -->
                    <el-table-column prop="roomTypeId" label="房间名称" width="400"></el-table-column>
                    <el-table-column prop="hour" label="入住时长" width="300"></el-table-column>
                    <el-table-column prop="Price" label="价格" width="300" align="right"></el-table-column>
                    <el-table-column fixed="right" label="操作">
                        <template slot-scope="scope">
                            <template>
                                <template>
                                    <el-button @click="editClick(2,scope.row)" type="text" size="small" class="tx-14">
                                        编辑
                                    </el-button>
                                    <template>
                                        <div class="el-divider el-divider--vertical"></div>
                                        <el-button type="text" size="small" class="tx-re tx-14"
                                            @click="delClick(scope.row)">删除</el-button>
                                    </template>
                                </template>
                            </template>
                        </template>

                    </el-table-column>
                </el-table>
                <div class="pt-12 pb-12 pl-8 pr-8 ub ub-sb br ub-ac " style="margin-top: -1px;">
                    <div>
                        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                            :current-page="params.pageNo" :page-size="params.pageSize" layout="total, prev, pager, next"
                            :total="total">
                        </el-pagination>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/babel">


        window.vm = new Vue({
            el: '#app',
            data: {
                conceal: "1",
                tableData: [
                    {
                        id: 1,
                        roomTypeId: 'zhangshan',
                        hour: 10,
                        Price: 100,
                    }
                ],
                total: 100,
                userinfo: Pms.getDate("userinfo", {}),
                params: {
                    pageNo: 1,
                    pageSize: 10,
                },
            },
            beforeCreate() {
                // top.vm.startLoading("加载中")
            },
            created() {
                this.getList();
            },
            directives: {
                dirName: {

                    //定义指令

                }

            },

            methods: {
                getList() {
                    // this.GET({ url: top.Config.curUrl + "/sys/sysUser/list", map: this.params }).then((res) => {
                    //     if (res.retcode == 200) { //如果返回码不是200则提示错误登录信息
                    //         this.tableData = res.result.pageInfo.list;
                    //         this.total = res.result.pageInfo.total;
                    //     } else { //如果返回码是200则登录成功
                    //         this.msgError(res.retmsg)
                    //     }
                    //     top.vm.closeLoading();
                    // })
                },
                //切换分页时触发
                handleCurrentChange(v) {
                    this.params.pageNo = v;
                    this.getList();
                },
                // 选择分页条数时触发
                handleSizeChange(v) {
                    this.params.pageSize = v;
                    this.getList();
                },
                // 编辑按钮
                editClick(isadd, row) {
                    console.log(row.id);
                    this.openDetailsWin({
                        id: "putup_Hourroomsetting_edit",
                        params: { miid: isadd, id: row.id || '' },
                        iframeUrl: "/web/view/putup/putup_Hourroomsetting_edit.html"
                    })

                },
                // 删除按钮
                // delClick(row) {
                //     this.confirm("您确认删除吗？").then(() => {
                //         row.status = -1
                //         this.POST({ url: top.Config.curUrl + "/sys/sysUser/del", map: row }).then((res) => {
                //             if (res.retcode == 200) { //如果返回码不是200则提示错误登录信息
                //                 setTimeout(() => {
                //                     this.getList();
                //                     this.msgSuccess("删除成功");
                //                 }, 1000);
                //             } else { //如果返回码是200则登录成功
                //                 this.msgError(res.retmsg);
                //             }
                //         })
                //     })
                // },
                // //选择项时触发
                // handleSelectionChange(row) {
                //     this.userCount = row.length
                // }
            }
        })

    </script>

</body>

</html>